/**
 * 布局结构
 * @constructor
 * @author neo   
*/
import React from 'react';
import { render, connect } from 'src/hrpub/common/frame';
import { base } from 'nc-lightapp-front';
import buttonAction from './action/buttonAction';
import './index.less';
const { NCModal, NCButton, NCFormControl } = base;
const Wrapper = render({
	actions: {
		buttonAction
	}
})(({ props, action, state }) => {
	const { psninfoApprove } = props;
	const { cancel, passed, failed, commentChange } = action.buttonAction;
	const { approveModalShow, lang, approveComment, maxlength } = psninfoApprove;
	return (
		<NCModal
			className="approve-modal"
			show={approveModalShow}
			onHide={cancel}
			width={400}
			style={{ height: '200px' }}
		>
			<NCModal.Header closeButton>
				<NCModal.Title>{lang['gx6008-000204']}</NCModal.Title>
			</NCModal.Header>
			<NCModal.Body>
				<NCFormControl componentClass="textarea" value={approveComment} onChange={commentChange} />
				<label
					style={{ position: 'absolute', bottom: '20px', right: '20px', color: '#e3e3e3', fontSize: '12px' }}
				>
					{approveComment.length}/{maxlength}
				</label>
			</NCModal.Body>
			<NCModal.Footer>
				<NCButton colors="default" onClick={failed}>
					{lang['gx6008-000206']}
				</NCButton>
				<NCButton colors="primary" onClick={passed}>
					{lang['gx6008-000205']}
				</NCButton>

				<NCButton colors="default" onClick={cancel}>
					{lang['gx6008-000025']}
				</NCButton>
			</NCModal.Footer>
		</NCModal>
	);
});

export default connect(Wrapper);
